//
// Copyright (C) 2013 OpenSim Ltd.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
//

#include "inet/physicallayer/wireless/common/radio/packetlevel/ReceptionDecision.h"

namespace inet {
namespace physicallayer {

ReceptionDecision::ReceptionDecision(const IReception *reception, IRadioSignal::SignalPart part, bool isReceptionPossible, bool isReceptionAttempted, bool isReceptionSuccessful) :
    reception(reception),
    part(part),
    isReceptionPossible_(isReceptionPossible),
    isReceptionAttempted_(isReceptionAttempted),
    isReceptionSuccessful_(isReceptionSuccessful)
{
}

std::ostream& ReceptionDecision::printToStream(std::ostream& stream, int level, int evFlags) const
{
    stream << "ReceptionDecision";
    if (level <= PRINT_LEVEL_DETAIL)
        stream << (isReceptionPossible_ ? ", possible" : ", impossible")
               << (isReceptionAttempted_ ? ", attempted" : ", ignored")
               << (isReceptionSuccessful_ ? ", successful" : ", unsuccessful");
    return stream;
}

} // namespace physicallayer
} // namespace inet

